package org.anyline.simple;

import org.anyline.proxy.ServiceProxy;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest(classes = QueryApplication.class)
public class NameQueryTest {
    @Test
    public void sql(){
        //XML中定义的SQL及查询条件按相同规则处理
        String sql = "SELECT * FROM FI_USER WHERE 1=1 ${AND (ID>:MAX OR ID<:MIN)} AND NAME IS NOT NULL ${AND LVL > :LVL} AND LVL < 20";

        // SELECT * FROM FI_USER WHERE NAME IS NOT NULL AND LVL < 20
        ServiceProxy.querys(sql);

        // SELECT * FROM FI_USER WHERE (ID>? OR ID<?) AND NAME IS NOT NULL AND LVL > ? AND LVL < 20
        ServiceProxy.querys(sql, "MAX:1", "MIN:10", "LVL:20");

        // SELECT * FROM FI_USER WHERE NAME IS NOT NULL AND LVL > ? AND LVL < 20
        ServiceProxy.querys(sql, "MAX:1", "LVL:30");

    }


}
